Class Message

Summary

Fully Qualified Name: Laminas\Mail\Storage\Message
Extends: Part
Implements: MessageInterface

Description

Methods

Name Description Defined By
__construct() Public constructor Message
__get() Getter for mail headers - name is matched in lowercase Part
__isset() Isset magic method proxy to hasHeader Part
__toString() magic method to get content of part Part
countParts() Count parts of a multipart part Part
current() implements Iterator::current() Part
getChildren() implements RecursiveIterator::getChildren() Part
getContent() Body of part Part
getFlags() get all set flags Message
getHeader() Get a header in specified format Part
getHeaderField() Get a specific field from a header like content type or all fields as array Part
getHeaders() Access headers collection Part
getPart() Get part of multipart message Part
getSize() Return size of part Part
getTopLines() return toplines as found after headers Message
hasChildren() implements RecursiveIterator::hasChildren() Part
hasFlag() check if flag is set Message
isMultipart() Check if part is a multipart message Part
key() implements Iterator::key() Part
next() implements Iterator::next() Part
rewind() implements Iterator::rewind() Part
valid() implements Iterator::valid() Part

Method Details

__construct()

Public constructor

In addition to the parameters of Part::__construct() this constructor supports:

Parameter Name Type Description
$params array

Returns:

__get()

Getter for mail headers - name is matched in lowercase

This getter is short for Part::getHeader($name, 'string')

Parameter Name Type Description
$name string header

Returns: string value of header

__isset()

Isset magic method proxy to hasHeader

This method is short syntax for Part::hasHeader($name);

Parameter Name Type Description
$ string
$name

Returns: bool

__toString()

magic method to get content of part

Returns: string content

countParts()

Count parts of a multipart part

Returns: int number of sub-parts

current()

implements Iterator::current()

Returns: \Part current part

getChildren()

implements RecursiveIterator::getChildren()

Returns: \Part same as self::current()

getContent()

Body of part

If part is multipart the raw content of this part with all sub parts is returned

Returns: string body

getFlags()

get all set flags

Returns: array array with flags, key and value are the same for easy lookup

getHeader()

Get a header in specified format

Internally headers that occur more than once are saved as array, all other as string. If $format is set to string implode is used to concat the values (with Mime::LINEEND as delim).

Parameter Name Type Description
$name string name
$format string change

Returns: string|array|\HeaderInterface|\ArrayIterator value of header in wanted or internal format

getHeaderField()

Get a specific field from a header like content type or all fields as array

If the header occurs more than once, only the value from the first header is returned.

Throws an Exception if the requested header does not exist. If the specific header field does not exist, returns null.

Parameter Name Type Description
$name string name
$wantedPart string the
$firstName string key

Returns: string|array wanted part or all parts as array($firstName => firstPart, partname => value)

getHeaders()

Access headers collection

Lazy-loads if not already attached.

Returns: \Headers

getPart()

Get part of multipart message

Parameter Name Type Description
$num int number

Returns: \Part wanted part

getSize()

Return size of part

Quite simple implemented currently (not decoding). Handle with care.

Returns: int size

getTopLines()

return toplines as found after headers

Returns: string toplines

hasChildren()

implements RecursiveIterator::hasChildren()

Returns: bool current element has children/is multipart

hasFlag()

check if flag is set

Parameter Name Type Description
$flag mixed a

Returns: bool true if set, otherwise false

isMultipart()

Check if part is a multipart message

Returns: bool if part is multipart

key()

implements Iterator::key()

Returns: string key/number of current part

next()

implements Iterator::next()

Returns:

rewind()

implements Iterator::rewind()

Returns:

valid()

implements Iterator::valid()

Returns: bool check if there's a current element

Top